<template>
  <el-dialog :title="title" :close-on-click-modal="false" :fullscreen="true" :visible.sync="visible"
    :before-close="cancel" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="50%">

    <div class="block">
    <el-timeline>
    <el-timeline-item timestamp="基本信息" placement="top">
      <el-card>
        <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
          <el-col :span="8">
            <el-form-item label="任务编号" prop="FBILLNO">
              <el-input v-model="dataForm.FBILLNO" disabled readonly="true"/>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="制定日期" prop="FBILLCREDATE">
              <el-input v-model="dataForm.FBILLCREDATE"  readonly="true"/>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="任务状态">
              <el-select v-model="dataForm.FBILLSTATE" placeholder="请选择" disabled>
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value" disabled>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="16">
            <el-form-item label="引用试卷">
              <el-select v-model="dataForm.FBILLSTATE" placeholder="请选择" >
                <el-option
                  v-for="item in options2"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value" disabled>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="考试时长" prop="FTIME">
              <el-input v-model="dataForm.FTIME"  readonly="true"/>
            </el-form-item>
          </el-col>

          <el-col :span="16">
            <el-form-item label="任务名称" prop="FCATNAME">
              <el-input v-model="dataForm.FCATNAME"  readonly="true"/>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="所属院系" prop="FHOME">
              <el-input v-model="dataForm.FHOME"  readonly="true"/>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="制定老师" prop="FTEACH">
              <el-input v-model="dataForm.FTEACH"  readonly="true"/>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="有效起日" prop="FBEGDATE">
              <el-input v-model="dataForm.FBEGDATE"  readonly="true"/>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="有效讫日" prop="FENDDATE">
              <el-input v-model="dataForm.FENDDATE"  readonly="true"/>
            </el-form-item>
          </el-col>

          <el-col :span="16">
            <el-form-item label="范围说明" prop="FNOTE">
              <el-input v-model="dataForm.FNOTE"  readonly="true"/>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="任务类型">
              <el-select v-model="dataForm.FBILLTYPE" placeholder="请选择" disabled>
                <el-option
                  v-for="item in options3"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value" disabled>
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        </el-form>
        </el-row>
      </el-card>
    </el-timeline-item>

    <el-timeline-item timestamp="学员列表" placement="top">
      <el-card>
        <el-table :data="list1" border stripe>
          <el-table-column label="操作" width="80">
            <template slot-scope="scope">
              <el-button slot="reference" icon="el-icon-delete" style="color: red" @click="shopdate(scope.$index)"
                type="text">删除</el-button>
            </template>
          </el-table-column>
          <el-table-column prop="FENTRYID" label="序号" width="80"></el-table-column>
          <el-table-column prop="FWORKTYPE" label="学员类型" width="90"></el-table-column>
          <el-table-column prop="FWORKNO" label="学籍号/手机号" ></el-table-column>
          <el-table-column prop="FWORKNAME" label="学员姓名"></el-table-column>
          <el-table-column prop="FMEMO" label="备注" ></el-table-column>
        </el-table>
        <div class="addbox">
             <el-link icon="el-icon-plus" type="primary" >选择学员</el-link>
             <el-link icon="el-icon-plus" type="primary" >导入学员</el-link>
        </div>
      </el-card>
    </el-timeline-item>
    
    <el-timeline-item timestamp="查看设置" placement="top">
      <el-card>
        <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
          
          <el-col :span="24">
            <el-form-item label="查看答题详情" prop="FOPTION1">
              <el-radio v-model="radio1" label="1">阅卷后</el-radio>
              <el-radio v-model="radio1" label="2">及格后</el-radio>
              <el-radio v-model="radio1" label="3">考试结束</el-radio>
              <el-radio v-model="radio1" label="4">不可见</el-radio>
            </el-form-item>
          </el-col>   
          
          <el-col :span="24">
            <el-form-item label="查看内容" prop="FOPTION1">
              <el-radio v-model="radio2" label="1">对错和答案解析</el-radio>
              <el-radio v-model="radio2" label="2">只看对错</el-radio>
            </el-form-item>
          </el-col>  

          <el-col :span="24">
            <el-form-item label="查看排行" prop="FOPTION1">
              <el-radio v-model="radio3" label="1">交卷后</el-radio>
              <el-radio v-model="radio3" label="2">及格后</el-radio>
              <el-radio v-model="radio3" label="3">考试结束</el-radio>
              <el-radio v-model="radio3" label="4">不可见</el-radio>
            </el-form-item>
          </el-col>  
        
         </el-form>
        </el-row>
      </el-card>
    </el-timeline-item>

    <el-timeline-item timestamp="学习要求" placement="top">
      <el-card>
        <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
          
          <el-col :span="8">
            <el-form-item label="考试次数" prop="FNUM2">
              <el-input v-model="dataForm.FNUM2"  readonly="true"/>
            </el-form-item>
          </el-col>   
          
          <el-col :span="8">
            <el-form-item label="及格线" prop="FNUM3">
              <el-input v-model="dataForm.FNUM3"  readonly="true"/>
            </el-form-item>
          </el-col> 
        
         </el-form>
        </el-row>
      </el-card>
    </el-timeline-item>

    <el-timeline-item timestamp="阅卷设置" placement="top">
      <el-card>
        <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
          
          <el-col :span="24">
            <el-form-item label="阅卷方式" prop="FOPTION1">
              <el-radio v-model="radio4" label="1">系统阅卷</el-radio>
              <el-radio v-model="radio4" label="2">人工阅卷</el-radio>
            </el-form-item>
          </el-col>   
          
                  
         </el-form>
        </el-row>
      </el-card>
    </el-timeline-item>

  </el-timeline>

</div>

  </el-dialog>
</template>
<script>
  import jnpf from "@/utils/jnpf"
  export default {
    components: {  },
    props: {
      formationlist: {
        type: Array,
        default: [],
      },
    },
    data() {
      return {
        textarea: '同意该项目',
        value1: new Date(2024, 12, 2, 12, 0),
        radio1:'1',
        radio2:'1',
        radio3:'1',
        radio4:'1',

        title: "新增",
        insertorupdate: true,
        dataForm: {
            FBILLNO: "S241130001", 
            FBILLCREDATE:"2024-11-03",
            FHOME:"化学与材料科学学院",
            FUSER:"曹操",
            FCATNAME:"化学实验安全学习",
            FTEACH:"秦始皇",
            FWEEK:"3个月",
            FBEGDATE:"2024-10-01",
            FENDDATE:"2024-12-31",
            FNOTE:"2024年届新生安全培训",
            FBILLSTATE:"待审批",
            FNUM2:"5",
            FNUM3:"60%",
            FTIME:"60分钟",
            FBILLTYPE:"定时考试"
        },
        rules: {
          FUSERNUMBER:[
            { required: true, message: '请输入学籍号码', trigger: 'blur' },
          ],
          FUSER: [
            { required: true, message: '请输入申请人员', trigger: 'blur' },
          ],
          FMEMO: [
            { required: true, message: '请输入申请理由', trigger: 'blur' },
          ],
        },
        list2: [{  "FENTRYID":1,
                    "FWORKTYPE":"化学系操作安全",
                    "FWORKNO": "单选题",
                    "FWORKNAME": "易燃化学试剂理想存放温度是多少?运行存放最高室温不得超过多少?",
                    "FMEMO": "☆"
                  },
                  { "FENTRYID":2,
                    "FWORKTYPE":"化学系操作安全",
                    "FWORKNO": "单选题",
                    "FWORKNAME": "a射线是下列哪种原子核",
                    "FMEMO": "☆"
                  },
                  { "FENTRYID":3,
                    "FWORKTYPE":"化学系操作安全",
                    "FWORKNO": "单选题",
                    "FWORKNAME": "对于相同厚度的下列物质,对IMeV能力的y涉嫌屏蔽效果好的是",
                    "FMEMO": "☆"
                  }],
        
        list1: [{ "FENTRYID":1,
                  "FWORKTYPE":"本院人员",
                  "FWORKNO": "1002",
                  "FWORKNAME": "刘备",
                  "FMEMO": ""
                },
                { "FENTRYID":2,
                  "FWORKTYPE":"本院人员",
                  "FWORKNO": "1003",
                  "FWORKNAME": "关羽",
                  "FMEMO": ""
                },
                { "FENTRYID":3,
                  "FWORKTYPE":"本院人员",
                  "FWORKNO": "1004",
                  "FWORKNAME": "张飞",
                  "FMEMO": ""
                }],
        loading: false,
        visible: false,

        //所属校区选择数据
        options1: [{
          value: '1',
          label: '申请中'
        }, {
          value: '2',
          label: '已通过'
        }, {
          value: '3',
          label: '已驳回'
        }],

        //所属校区选择数据
        options2: [{
          value: '1',
          label: '本院人员'
        }, {
          value: '2',
          label: '培训人员'
        }, {
          value: '3',
          label: '外来人员'
        }],

        options3: [{
          value: '1',
          label: '学习任务'
        }, {
          value: '2',
          label: '定时任务'
        }],
        
      };
    },
    created() {
    },
    mounted() { },
    methods: {
      //
      init(FBILLNO) {
        this.dataForm.FBILLNO = FBILLNO;
        if (this.dataForm.FBILLNO) {
          this.title = "修改"
          this.insertorupdate = false;
        }
        else {
          this.title = "新增"
          this.dataForm.FBILLNO = "K" + Math.floor(Math.random() * 10000000) + 1;
          this.insertorupdate = true;
        }
        this.visible = true;
      },
      shoplist(data) {
        data.forEach(item => {
          this.list.push({
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "1"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "曹操"
          },{
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "2"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "刘备"
          })
        });
      },
      //
      cancel() {
        this.list = [];
        this.visible = false;
      },
    },
  };
</script>